﻿<?xml version="1.0" encoding="utf-8"?>
<Application x:Class="Quizzer.App" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:vm="clr-namespace:Quizzer.ViewModel" 
             xmlns:views="clr-namespace:Quizzer.Views"
             StartupUri="MainView.xaml" 
             mc:Ignorable="d">
    <Application.Resources>
        <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" />

        <!--
            We define the data templates here so we can apply them across the
            entire application.
            
            The data template just says that if our data type is of a particular
            view-model type, then render the appropriate view.  The framework
            takes care of this dynamically.  Note that the DataContext for
            the underlying view is already set at this point, so the
            view (UserControl), doesn't need to have it's DataContext set
            directly.
        -->
        <DataTemplate DataType="{x:Type vm:LoginViewModel}">
            <views:LoginPage/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:RegistrationViewModel}">
            <views:RegistrationPage/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:CoursesViewModel}">
            <views:CoursesPage/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ProfileViewModel}">
            <views:ProfilePage/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:TestInfoViewModel}">
            <views:TestInfoPage/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:QuestionViewModel}">
            <views:QuestionPage/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:TestResultViewModel}">
            <views:TestResultPage/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:CreateTestViewModel}">
            <views:CreateTestPage/>
        </DataTemplate>
        
    </Application.Resources>
</Application>